<?php
class MY_Controller extends CI_Controller{
	
	protected $layout_view = 'default';
    protected $content_view ='';
    protected $data = array();
	protected $title = 'Application System';
	function __construct(){
		parent::__construct();
		 
	}

	public function _output($output)
    {	
		
		if($this->content_view !== FALSE && empty($this->content_view)) $this->content_view = $this->router->class . '/' . $this->router->method;
       
        $yield = file_exists(APPPATH . 'views/' . $this->content_view . EXT) ? $this->load->view($this->content_view, $this->data, TRUE) : FALSE ;
 		
        if($this->layout_view){
			
          echo  $this->load->view('layouts/' . $this->layout_view, array('yield' => $yield, 'title' => $this->title), TRUE);
		}
        else {
            echo $yield;
		}
		
    }
	

}
?>